package com.example.mygrade.service;


import com.example.mygrade.core.PageUtils;
import com.example.mygrade.domain.Student;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Service
public interface StudentService {


    List<Student> findAll() throws Exception;

    /**
     * 按id进行查询
     * @param id
     * @return
     */
    Student findById(Integer id);

    /**
     * 按姓名进行查询
     * @param name
     * @return
     */
//    List<Student> findBySname(String name);

    /**
     * 根据学号和姓名进行查询
     * @param name
     * @param sno
     * @return
     */
    List<Student> findBySnameAndSno(String name,String sno) throws Exception;

    List<Student> findBySno(String sno);

    List<Student> findBySnameAndPassword(String name,String password);

    Student insert(Student student);

    Student update(Student student);

    void delete(Integer id);

    Page<Student> findAll(Pageable pageable);
    Page<Student> findAll(Example<Student> student,Pageable pageable);
    void delete(Integer[] arr);

    int insertStudent(MultipartFile file) throws Exception;

    Student findBySnameLike(String name);

    void exportStudent(HttpServletResponse response);
}

